.\" $Id: PAPI_num_events.3,v 1.5 2004/10/04 02:16:28 jthomas Exp $
.TH PAPI_num_events 3 "September, 2004" "PAPI Programmer's Reference" "PAPI"

.SH NAME
PAPI_num_events \- return the number of events in an event set
.SH SYNOPSIS
.B C Interface
.nf
.B #include <papi.h>
.BI "int PAPI_num_events(int " EventSet ");"
.fi
.B Fortran Interface
.nf
.B #include "fpapi.h"
.BI PAPIF_num_events(C_INT\  EventSet,\  C_INT\  count)
.fi

.SH DESCRIPTION
.LP
.B PAPI_num_events(\|)
returns the number of preset events contained in an event set.
The event set should be created by
.BR "PAPI_create_eventset" (3).

.SH ARGUMENTS
.I EventSet 
--  an integer handle for a PAPI event set as created by
.BR "PAPI_create_eventset" (3)
.LP
.I *count 
-- On output the variable contains the number of events in the
event set.
.LP

.SH RETURN VALUES
On success, this function returns the positive number of events in the event set.
On error, a non-zero error code is returned.

.SH ERRORS
.TP
.B "PAPI_EINVAL"
The event count is zero; only if code is compiled with debug enabled.
.TP
.B "PAPI_ENOEVST"
The EventSet specified does not exist.
.TP

.SH EXAMPLES
.nf
.if t .ft CW
  /* Count the events in our EventSet */
  printf("%d events found in EventSet.\n", PAPI_num_events(EventSet));

.if t .ft P
.fi

.SH BUGS
This function has no known bugs.

.SH SEE ALSO
.BR PAPI_add_event "(3)," PAPI_create_eventset "(3)," PAPI "(3)," PAPIF "(3)"
